<%@page import="com.situ.student.entity.PageBean2"%>
<%@page import="com.situ.student.dao.IStudentDao"%>
<%@page import="com.situ.student.entity.Student"%>
<%@page import="java.util.List"%>
<%@page import="com.situ.student.service.impl.StudentServiceImpl"%>
<%@page import="com.situ.student.service.IStudentService"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="lib/bootstrap-3.3.7-dist/css/bootstrap.css"/>
		</head>
	<body>
		<%
			PageBean2 pageBean = (PageBean2)request.getAttribute("pageBean");
		%>
		<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
		<%
		System.out.println("pageBean="+pageBean);
		%>
		<!--导航栏开始 -->
			<nav class="navbar navbar-default">
			  <div class="container">
			    <!-- Brand and toggle get grouped for better mobile display -->
			    <div class="navbar-header">
			      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
			        <span class="sr-only">Toggle navigation</span>
			        <span class="icon-bar"></span>
			        <span class="icon-bar"></span>
			        <span class="icon-bar"></span>
			      </button>
			      <a class="navbar-brand" href="#">教务管理系统</a>
			    </div>
			
			    <!-- Collect the nav links, forms, and other content for toggling -->
			    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
			      <ul class="nav navbar-nav">
			        <li class="active"><a href="#"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> 学生管理 <span class="sr-only">(current)</span></a></li>
			        <li><a href="/Java823Web/BanjiServlet?method=pageList"><span class="glyphicon glyphicon-home" aria-hidden="true"></span> 班级管理</a></li>
			        <li><a href="/Java823Web/kecheng?method=list"><span class="glyphicon glyphicon-list-alt" aria-hidden="true"></span> 课程管理</a></li>
			        <li><a href="#"><span class="glyphicon glyphicon-tag" aria-hidden="true"></span> 教务管理</a></li>
			        <li><a href="#"><span class="glyphicon glyphicon-th-large" aria-hidden="true"></span> 在线管理员</a></li>
			      </ul>
			      <ul class="nav navbar-nav navbar-right">
			        <li><a href=""><span class="glyphicon glyphicon-off" aria-hidden="true"></span> 退出</a></li>
			        <!-- Java823Web/session>method=logout -->
			      </ul>
			    </div><!-- /.navbar-collapse -->
			  </div><!-- /.container-fluid -->
			</nav>
		<!--导航栏结束 -->
		<!--正文开始-->
		<div class="container">
			<div class="row">
				<!--左侧导航栏开始  -->
				<div class="col-md-2">
					<div class="list-group">
					  <a href="" class="list-group-item active">
					   	学生列表
					  </a>
					  <a href="/Java823Web/student?method=banjilist" class="list-group-item">学生添加</a>
					</div>
				</div>
				<!--左侧导航栏结束 -->
				<!--右侧数据栏开始 -->
				<div class="col-md-10">
				<form action="" id="mainForm" method="post">
					<table class="table table-striped">
					
						<tr>
							<td>id</td>
							<td>姓名</td>
							<td>年龄</td>
							<td>性别</td>
							<td>班级</td>
							<td>修改</td>
							<td>删除</td>
						</tr>
						<!--用EL语句写循环  -->
						 	<c:forEach items="${pageBean.list}" var="map">
								<tr>
									<td>${map.id}</td>
									<td>${map.name}</td>
									<td>${map.age}</td>
									<td>${map.gender}</td>
									<td>${map['banji_name']}</td><!-- ???0 -->
									<td><a href="/Java823Web/student?method=toupdate&id=${map.id}">修改</a></td>
									<td><a href="/Java823Web/student?method=deleteById&id=${map.id}">删除</a></td>
								</tr>
							</c:forEach>
						</form>
						<%-- <%
							for (Student student:list) { 
						%>
						<tr>
							<td><%=student.getId()%></td>
							<td><%=student.getName()%></td>
							<td><%=student.getAge()%></td>
							<td><%=student.getGender()%></td>
							<td>
								<a href="/Java823Web/student?method=toupdate&id=<%=student.getId()%>">修改</a>
							</td>
							<td>
								<a href="/Java823Web/student?method=deleteById&id=<%=student.getId()%>">删除</a>
							</td>
						</tr>
						
						<%
							}
						%>
						 --%>
								
					</table>
					
					<!-- 分页按钮 开始-->
							<nav aria-label="Page navigation">
								<nav aria-label="Page navigation">
								  <ul class="pagination">
								    <li>
								      <a href="#" aria-label="Previous">
								        <span aria-hidden="true">&laquo;</span>
								      </a>
								    </li>
								   <!--  <li><a href="#">1</a></li> -->
								   		<%
									    	for (int i = 1; i <= pageBean.getTotalPage(); i++) {
									    		if (i == pageBean.getPageNo()) {
									    %>
													<li class="active"><a href="#"><%=i%></a></li>
									    <% 		
									    		} else {
									    %>
													<li><a href="/Java823Web/student?method=pageList&pageNo=<%=i%>&pageSize=3"><%=i%></a></li>
										<%
									    		}
									    	}
									    %>
								   
								    <li>
								      <a href="#" aria-label="Next">
								        <span aria-hidden="true">&raquo;</span>
								      </a>
								    </li>
								  </ul>
								</nav>
					<!-- 分页按钮 结束-->
				</div>
				<!--右侧数据栏结束 -->
				</div>
			</div>
		<!--正文结束-->
		
		<script src="lib/jquery/jquery-1.11.1.js" type="text/javascript" charset="utf-8"></script>
		<script src="lib/js/bootstrap.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" src="lib/bootstrap-3.3.7-dist/js/bootstrap.js" ></script>
	</body>
</html>
